# "1.登录前台用户中心，点击“账号余额”按钮，点击“提现按钮”。
# 2.编写提现金额“10000”，支付名称/开户银行“支付宝”，账户名称/开户名称“支付宝”，账号/卡号“10086”.
# 3.点击“申请提现”按钮，点击“审核”按钮，所有值默认，提现状态勾选同意且完成，审核意见“同意”，点击“保存审核”按钮。
# 4.登录前台界面，查看审核通过，提现成功"
testCase43='DBshop043_审核体现提现申请流程'
import  time
from public.action import *
from public.testData import *
from public.tools import*
from public.business import *
firefox=openBrowser(url)
DBshopLogin(firefox,userName,password)
firefox.find_element_by_link_text('用户中心').click()
firefox.find_element_by_link_text('账户余额').click()
firefox.find_element_by_link_text('提现').click()
time.sleep(5)
firefox.find_element_by_id('money_change_num').send_keys('10000')
firefox.find_element_by_id('bank_name').send_keys('支付宝')
firefox.find_element_by_id('bank_account').send_keys('支付宝')
firefox.find_element_by_id('bank_card_number').send_keys('10086')
firefox.find_element_by_xpath('//button[text()="申请提现"]').click()

#后台审核

firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'客户管理','客户余额','提现申请')
firefox.find_element_by_link_text('审核').click()
firefox.find_element_by_id('withdraw_info').send_keys('同意')
firefox.find_element_by_xpath('//button[text()="保存审核"]').click()
firefox.quit()
#
firefox=openBrowser(url)
DBshopLogin(firefox,userName,password)
firefox.find_element_by_link_text('用户中心').click()
firefox.find_element_by_link_text('账户余额').click()

try:
    firefox.find_element_by_xpath('//td[text()="提现已经完成"]').is_displayed()
    writeLog('%s 测试通过' % testCase43)
except:
    writeLog('%s 测试不通过' % testCase43)
    getPhoto(firefox)
firefox.quit()